// pages/listInfo/listInfo.js
const app = getApp();
const util = require("../../utils/util")
Page({
  data: {
    listInfo: null,
    productList: [],
    temperature: ["正常冰", "少冰", "去冰", "常温", "温热", "烫热"],
    //extra Hot=2; Hot=1; normal0; no ice=-1; less ice=-2; iced=-3 
    sweetness: ["无糖", "微糖", "半糖", "少糖", "全糖"],
    //no sugar=0; 25% sugar=1; 50% sugar=2; 75% sugar=3; 100% sugar=4
    review: ""
  },


  onShow: function (options) {
    var that=this
    this.setData({
      productList:  app.globalData.productList
    })
    this.setData({
      listInfo: app.globalData.listInfo
    })
    
    wx.request({
      url: util.BASE_URL+'/get/getonereview',
      method: 'POST',
      data:{
        orderListId:this.data.listInfo.id
      },
      success(res){
        that.setData({
          review: res.data.content
        })
        console.log(that.data.review)
      }
    })
    console.log(this.data.listInfo)
  },
  onHide: function(){
    this.setData({
      listInfo: null
    })
  },
  review(){
    wx.navigateTo({
      url: '/pages/setReview/setReview'
    })
  }
})